home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-08 | 1.1 KB | 20 lines | [TEXT/ttxt] |
- -- This script demonstrates accessing searchable files from MacHTTP.
- -- (What it really shows is how to pass arguments to AppleScripts.)
- -- http_search_args is a predefined variable that is passed from the server
- -- to the script and contains the user-supplied arguments. If the arguments
- -- are empty, the script asks the WWW client to prompt for them.
- -- If arguments were passed, then the script behaves accordingly.
- -- Note: the <ISINDEX> HTML tag is what tells the client the document is searchable
- -- and arguments should be collected and passed.
-
- --set http_10_header to "HTTP/1.0 200 OK" & return & "Server: MacHTTP 1.2" & return & ¬
- -- "MIME-version: 1.0" & return & "Content-type: text/html" & return
- set http_10_header to ""
- if http_search_args = "" then
- return http_10_header & "<ISINDEX><h2>Please enter the keyword to search for.</h2>"
- else if http_search_args = "hello" then
- return http_10_header & "<h2>Hello, how are you?</h2>"
- else
- return http_10_header & "<h2>Sorry, I don't understand '" & ¬
- http_search_args & "'. Try 'hello' instead.</h2>"
- end if